<?php
namespace core;

class Core
{
    public function run()
    {
        
    }
    public function route() {
        $url = $_SERVER['REQUEST_URI'];
        $postion = strpos($url, '?');
        $url = $postion === false ? $url : substr($url, 0, $postion);
        $url = trim($url, '/');
        if ($url) { 
            $urlArray = explode('/', $url);
            $controllerName = ucfirst($urlArray[0]) . 'Controller';
            $actionName =   'action' . ucfirst($urlArray[1]);
        }
    }
    // 自动加载类
    public function loadClass($className) {
        $className = str_replace('\\','/',$className);
        $file = $className . '.php';
        if (is_file($file)) {
            require_once $file;
        }
    }

}
